import static org.junit.Assert.assertFalse;
import junit.framework.TestCase;


public class LiczbaTest extends TestCase {
	Liczba l = null;

	protected void setUp() throws Exception {
		l = new Liczba();
	}

	public final void testSetValue() {
		assertNotNull(l);
	}

	public final void testConvertTo() {
		for(int j = 2 ; j<16 ; j++){
			for(int i = 0 ; i < 1000; i++){
				try{
					l.setValue(i);
					String result = l.convertTo(j);
					assertNotNull(l);
					assertFalse(Integer.toString(i, j) == result);
					assertTrue("Wrong result" , result.equals(Integer.toString(i, j)));
					assertEquals("Wrong result" , result , Integer.toString(i,j));
					assertNotSame("Wrong result" , result.equals(Integer.toString(i,j)) == true);
					if(l == null)
						fail("Wrong result");
				}catch(LiczbaExcept e)
				{
					System.out.println(e.getMessage());
				}
			}
		}
	}
}
